#ifndef _INPUT_H
#define _INPUT_H

#include <dinput.h>

#define BUTTON_DOWN(obj, button) (obj.rgbButtons[button] & 0x80)

#define KEYBOARD_BUFFER_SIZE	1024


class Input
{
private:
	LPDIRECTINPUT8       _di;		// The DirectInput object         
	LPDIRECTINPUTDEVICE8 _Keyboard;	// The keyboard device

	BYTE  _KeyStates[256];			// DirectInput keyboard state buffer 
	// Buffered keyboard data
	DIDEVICEOBJECTDATA _KeyEvents[ KEYBOARD_BUFFER_SIZE ];

	int _Key_Down;
	int _Key_Up;

	HWND _hWnd;

public:
	Input(HWND hWnd);
	~Input();


	void _InitDirectInput(HWND); //ham k su dung
	void _Init_Keyboard(HWND); //ham k su dung
	void _Process_KeyBoard();
	void _ReadKeyBoard();
	int IsKeyDown(int KeyCode);
	int GetKeyDown();
	int GetKeyUp();


};


#endif